package com.alibaba.day0318yk.iterator;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @description:
 * @author: Wang
 * @create: 2024-03-18 12:49
 **/
@SpringBootApplication
public class WebConfig implements WebMvcConfigurer {
    @Autowired
    private KcIterator kcIterator;
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(kcIterator)
                .addPathPatterns("/**")
                .excludePathPatterns("/css/**")
                .excludePathPatterns("/js/**")
                .excludePathPatterns("/user/toLogin")
                .excludePathPatterns("/user/login");
    }
}
